package com.easy.controller;

import com.easy.util.LayData;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
@ControllerAdvice
public class ShoppingExceptionHandler {
    @ExceptionHandler(value= NullPointerException.class)
    @ResponseBody
    public LayData handlerException(Exception e){
        e.printStackTrace();
        return LayData.error(e);
    }
}
